<?php 
/**
 * 站点首页模板
 */
if(!defined('EMLOG_ROOT')) {exit('error!');} 
?>

<section class="container">
	<div class="content-wrap">
	<div class="content">
	<?php if(blog_tool_ishome()&&_g("index_isppt")=="yes"){?>
<div id="homeslider" class="carousel slide" data-ride="carousel"><ol class="carousel-indicators"><li data-target="#homeslider" data-slide-to="0" class="active"></li><li data-target="#homeslider" data-slide-to="1" class=""></li><li data-target="#homeslider" data-slide-to="2" class=""></li></ol><div class="carousel-inner" role="listbox"><div class="item active"><a target="_blank" href="<?php echo _g("ppt_url1");?>"><img src="<?php echo _g("ppt_image1");?>" alt="草窝Blog"></a></div><div class="item"><a target="_blank" href="<?php echo _g("ppt_url2");?>"><img src="<?php echo _g("ppt_image2");?>" alt="blog.yesfree.pw"></a></div><div class="item"><a target="_blank" href="<?php echo _g("ppt_url3");?>"><img src="<?php echo _g("ppt_image3");?>" alt="blog.yesfree.pw"></a></div></div><a class="left carousel-control" href="#homeslider" role="button" data-slide="prev"><i class="fa fa-angle-left"></i></a><a class="right carousel-control" href="#homeslider" role="button" data-slide="next"><i class="fa fa-angle-right"></i></a></div>		
<?php }?>
		<div class="title">
			<h3>最新发布</h3>
		</div>
<?php doAction('index_loglist_top'); ?>

<?php 
if (!empty($logs)):
$logs=array_slice($logs,0,2);
foreach($logs as $value): 
?>

			<?php
				/*图片和摘要*/
		    	preg_match_all("|<img[^>]+src=\"([^>\"]+)\"?[^>]*>|is", $value['log_description'], $img);
				if($imgsrc = !empty($img[1])){ $imgsrc = $img[1][0];?>
				<?php }else{ 
					preg_match_all("|<img[^>]+src=\"([^>\"]+)\"?[^>]*>|is", $value['content'], $img);
					if($imgsrc = !empty($img[1])){ $imgsrc = $img[1][0]; ?>
					<?php }else{
						$imgsrc =TEMPLATE_URL."images/random/".rand(1,8).".jpg";
						?>
					<?php }?>
			<?php }?>
	
	
	<article class="excerpt excerpt-1"><a class="focus" href="<?php echo $value['log_url']; ?>"><img class="thumb" src="<?php echo $imgsrc;?>" style="display: inline;"></a><header><?php blog_sort($value['logid']); ?> <h2><a href="<?php echo $value['log_url']; ?>" title="<?php echo $value['log_title']; ?>"><?php echo $value['log_title']; ?></a></h2></header><p class="meta"><time><i class="fa fa-clock-o"></i><?php echo gmdate('Y-n-j', $value['date']); ?></time><span class="pv"><i class="fa fa-eye"></i>阅读(<?php echo $value['views']; ?>)</span><span class="pc"><i class="fa fa-comments-o"></i>评论(<span id="sourceId::6312" class="cy_cmt_count"><?php echo $value['comnum']; ?></span>)</span></p><p class="note"><?php echo $logdes = tool_purecontent($value['content'], 180); ?></p></article>
<?php 
endforeach;
else:
?>
	<h2>未找到</h2>
	<p>抱歉，没有符合您查询条件的结果。</p>
<?php endif;?>


<div class="row index_widget_cms">
<?php sort_name(0);?>


</div>
</div></div>

<?php
 include View::getView('side');
 include View::getView('footer');
?>
</section><!-- end #contentleft-->
